package com.etnet.streamserver.view;

import com.etnet.streamserver.view.client.ConnManager;
import com.etnet.streamserver.view.client.NssSenderManager;
import com.etnet.streamserver.view.client.ResultData;
import java.io.PrintStream;
import java.util.Arrays;

public class ConnManagerTest {
    public static void main(String[] args) throws InterruptedException {
        ConnManager connManager = ConnManager.getInstance();
        connManager.start("192.168.1.203", "9876");

        Thread.sleep(3000L);

        String msgStr = NssSenderManager.sendMsgStr("7", "1", new String[] { "1", "1161" });
        connManager.sendMessage(msgStr);
        ResultData rsData = connManager.getMessage("7");

        String[] header = rsData.getHeader().split("\n");
        String[] content = rsData.getContent().split("\n");

        System.out.println("header:" + Arrays.toString(header));
        System.out.println("content:" + Arrays.toString(content));
    }
}